package cn.chencaiju.day03;

import java.util.Arrays;

import org.junit.Test;

public class IsSort {
	public boolean isSort(int[] nums) {
		boolean flag=true;
		for(int i=0;i<nums.length-1;i++) {
			if(nums[i]>nums[i+1]) {
				flag=false;
				break;
			}
		}
		return flag;
	}
	@Test public void testIsSort() {
		int[] nums=new int[10];
		for(int i=0;i<nums.length;i++) {
//			nums[i]=(int) (Math.random()*100);
			nums[i]=i;
		}
		System.out.println("原始数组："+Arrays.toString(nums));
		System.out.println(isSort(nums));
	}

}
